<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<script src="js/jquery-3.1.1.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/angular.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/angular-ui-router.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
		<link rel="stylesheet" type="text/css" href="js/bootstrap.min.css"/>
		<link rel="stylesheet" type="text/css" href="css/kaoshi.css"/>
	</head>
	<body ng-app="myApp" ng-controller="Ctrl">
		<div class="wrap">
			<header>
				<h3>资讯</h3>
			</header>
			
		<!--*********轮播***********-->
			<div id="carousel-example-generic" class="carousel slide a" data-ride="carousel" data-interval="2000">
			  <ol class="carousel-indicators">
			    <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
			    <li data-target="#carousel-example-generic" data-slide-to="1"></li>
			    <li data-target="#carousel-example-generic" data-slide-to="2"></li>
			    <li data-target="#carousel-example-generic" data-slide-to="3"></li>
			  </ol>
			
			  <div class="carousel-inner" role="listbox">
			    <div class="item active">
			      <img src="img/hd1.jpg\" alt="...">
			    </div>
			    <div class="item">
			      <img src="img/hd2.jpg" alt="...">
			    </div>
			    <div class="item">
			      <img src="img/hd3.jpg" alt="...">
			    </div>
			    <div class="item">
			      <img src="img/hd4.jpg" alt="...">
			    </div>
			  </div>
			
			  <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
			    <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
			    <span class="sr-only">Previous</span>
			  </a>
			  <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
			    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
			    <span class="sr-only">Next</span>
			  </a>
		</div>
		
		<!--**********content内容************-->
		
		<div class="content" ui-view>
			
			
			<dl ng-repeat="x in arr">
				<dt>
					<img class="img1" ng-src="{{x.img}}"/>
				</dt>
				<dd>
					<h5>{{x.title}}</h5>
					<span class="span2">{{x.descrip}}</span>
					<p class="p2">
						<h5>{{x.time}}<span class="span1">&nbsp;{{x.rcount}}万阅</span></h5>
					</p>
				</dd>
				
			</dl>
			
			
		</div>
		
		<!--*******wrap******-->
		</div>
		<!--***********底部切换**************-->
		<footer>
			<p>
			 <a ui-sref="zixun">咨询</a>
			 <a ui-sref="play">玩家</a>
			 <a ui-sref="hero">英雄</a>
			 <a ui-sref="video">视频</a>
			</p>
		</footer>
		
	</body>
	
	<script type="text/javascript">
	
		var app=angular.module("myApp",["ui.router"]);
		//************路由**************
		app.config(function($stateProvider,$urlRouterProvider){
			$urlRouterProvider.otherwise("/");
			$stateProvider
			.state({
				name:"zixun",
				url:"/zixun",
			})
			.state({
				name:"play",
				url:"/play",
				templateUrl:"view/play.html"
			})
			.state({
				name:"hero",
				url:"/hero",
				templateUrl:"view/hero.html"
			})
			.state({
				name:"video",
				url:"/video",
				templateUrl:"view/video.html"
			})
		})
		
		//**************主控制器******************
		app.controller("Ctrl",function($scope,$http){
			//***************调取数据*************
			$http.get("http://127.0.0.1:8070").then(function(res){
				console.log(res.data.data)
				$scope.arr=res.data.data;
			})
		})
		
	</script>
</html>
